/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/bluetooth.html#wxnotifyblecharacteristicvaluechangeobject)
 */

export default function write_ble_characteristic_value(deviceId: string, serviceId: string, characteristicId: string, state: boolean) {
	return new Promise<boolean>((resolve, reject) => {
		wx.notifyBLECharacteristicValueChanged({
			characteristicId,
			deviceId,
			serviceId,
			state,
			success() {
				resolve(true);
			},
			fail() {
				reject(false);
			}
		});
	});
}
